<!DOCTYPE html>
<html>

<head>
  <meta charset='utf-8'>
  <meta http-equiv="X-UA-Compatible" content="chrome=1">
  <meta name="description" content="H5 : ">

  <link rel="stylesheet" type="text/css" media="screen" href="stylesheets/stylesheet.css">
  <link rel="stylesheet" href="main.css">
  <title>诊断你适合哪种奇葩职业</title>
  <link rel="icon" href="favicon.ico" type="image/x-icon">
  <script src="flex.js"></script>
  <style media="screen">

  </style>
</head>
<div class="wp">
  <img src="Andy.png" alt="" class="ppp">
  <div class="wp-inner">
    <div class="page page1 step1">
      <img src="1bg.png" alt="">
      <a href="javascript:;" class="page1-btn" id="gg"></a>
      <div class="arrow"></div>
      <div class="title"></div>
    </div>
    <div class="page page2 step2">
      <div class="page2-content">
        <h3 class="p2-t"></h3>
        <input type="text" id="i1" name="" placeholder="姓名"  value="">
        <input type="text" id="i2"  name=""placeholder="职业"   value="">
        <a href="javascript:;" class="p2-btn" id="ggg"></a>
      </div>
    </div>
    <div class="page page3 step3">
      <img id="go" src="" alt="">
    </div>

  </div>
</div>

<body>

  <script src="zepto.js"></script>
  <script src="zepto.fullpage.js"></script>
  <script type="text/javascript">
  var arr = [
    '1.jpg',
    '2.jpg',
    '3.jpg',
    '4.jpg',
    '5.jpg',
    '6.jpg',
    '7.jpg',
    '8.jpg',
    '9.jpg',
    '10.jpg',
    '11.jpg',
    '12.jpg',
    '13.jpg'
  ];
    $('.wp-inner').fullpage();
    selectImg = '1.jpg';
    var selectImg = arr[parseInt(Math.random() * arr.length)];
    $('#go').get(0).src = selectImg;

    $('.wp-inner').fullpage({
      moveNext: function () {
        console.log(1);
      }
    });
    $('#gg').click(function () {
      console.log(122);
      $.fn.fullpage.moveNext(2);
    })
    // $("#i1").focus(function () {
    //   var selectImg = arr[parseInt(Math.random() * arr.length)];
    //   $('#go').get(0).src = selectImg;
    // });
    // $("#i2").focus(function () {
    //   var selectImg = arr[parseInt(Math.random() * arr.length)];
    //   $('#go').get(0).src = selectImg;
    // });
    // $("#i3").focus(function () {
    //   var selectImg = arr[parseInt(Math.random() * arr.length)];
    //   $('#go').get(0).src = selectImg;
    // });
    $('#ggg').click(function () {
      console.log(122);
      var timer  = null;
      var selectImg = arr[parseInt(Math.random() * arr.length)];
      // console.log($("#i1").value());
      // console.log($("#i2").value());
      // console.log($("#i3").value());
      console.log(selectImg);
      if (!$("#i1").val() ||
          !$("#i2").val()) {
            return;
      }
      // $('#go').get(0).src = selectImg;
      $.fn.fullpage.moveNext(2);
    });


  </script>


</body>

</html>
